<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>css-notes</title>
  <style>
    div {
      width: 100px;
      height: 100px;
      background: red;
      animation: myfirst 5s;
      -moz-animation: myfirst 5s; /* Firefox */
      -webkit-animation: myfirst 5s; /* Safari and Chrome */
      -o-animation: myfirst 5s; /* Opera */
    }

    @keyframes myfirst {
      from {
        background: red;
      }
      to {
        background: yellow;
      }
    }

    @-moz-keyframes myfirst /* Firefox */
    {
      from {
        background: red;
      }
      to {
        background: yellow;
      }
    }

    @-webkit-keyframes myfirst /* Safari and Chrome */
    {
      from {
        background: red;
      }
      to {
        background: yellow;
      }
    }

    @-o-keyframes myfirst /* Opera */
    {
      from {
        background: red;
      }
      to {
        background: yellow;
      }
    }
  </style>
</head>
<body>
<div></div>
<p><b>注释：</b>本例在 Internet Explorer 中无效。</p>
</body>
</html>
